
function showOkDialog(message, dialogHeight, dialogTitle, okCallback) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-message-content").html(message);
    $("#dialog-message").dialog({
        height: dialogHeight,
        modal: true,
        title: dialogTitle,
        resizable: false,
        buttons: {
            Ok: function () {
                $(this).dialog("close");
                if (okCallback != undefined) {
                    okCallback();
                }
            }
        }
    });
}



function showDialogWidthAndHeightNoCallback(message, dialogWidth, dialogHeight, dialogTitle) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-message-content").html(message);
    $("#dialog-message").dialog({
        width: dialogWidth,
        height: dialogHeight,
        modal: true,
        title: dialogTitle,
        resizable: false,
        buttons: {
            Ok: function () {
                $(this).dialog("close");
            }
        }
    });
}



function showDialogWidthAndHeightNoCallbackAndNoScroll(message, dialogWidth, dialogHeight, dialogTitle) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-message-content").html(message);
    $("#dialog-message").dialog({
        width: dialogWidth,
        height: dialogHeight,
        modal: true,
        title: dialogTitle,
        resizable: false,
        buttons: {
            Ok: function () {
                $(this).dialog("close");
            }
        }
    });
    $("#dialog:ui-dialog").css('overflow','hidden');
}



function showNoButtonsDialog(message, dialogHeight, dialogTitle) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-message-content").html(message);
    $("#dialog-message").dialog({
        height: dialogHeight,
        modal: true,
        title: dialogTitle,
        resizable: false
    });
}



function showYesNoDialog(message, dialogHeight, dialogTitle, yesCallback, noCallback) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-message-content").html(message);
    $("#dialog-message").dialog({
        height: dialogHeight,
        modal: true,
        title: dialogTitle,
        resizable: false,
        buttons: {
            Yes: function () {
                $(this).dialog("close");
                if (yesCallback != undefined) {
                    yesCallback();
                }
            },
            No: function () {
                $(this).dialog("close");
                if (noCallback != undefined) {
                    noCallback();
                }
            }
        }
    });
}


function showYesNoGroupSnippetDialog(message, dialogHeight, dialogTitle, deleteSingleCallback, deleteAllCallback, noCallback) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-message-content").html(message);
    $("#dialog-message").dialog({
        height: dialogHeight,
        modal: true,
        title: dialogTitle,
        resizable: false,
        buttons: {
            "Delete Single": function () {
                $(this).dialog("close");
                if (deleteSingleCallback != undefined) {
                    deleteSingleCallback();
                }
            },
            "Delete All": function () {
                $(this).dialog("close");
                if (deleteAllCallback != undefined) {
                    deleteAllCallback();
                }
            },
            No: function () {
                $(this).dialog("close");
                if (noCallback != undefined) {
                    noCallback();
                }
            }
        }
    });
}





function populateSelect(id, data, valueSelect, textSelect) {
    $(id).empty();
    for (var i = 0; i < data.length; i++) {
        $(id).append($('<option />').attr('value', valueSelect(data[i])).text(textSelect(data[i])));
    }
}



function SwitchHightlighting(stylename) {
/*
    $("pre.c" + "Code").snippet("c", { style: stylename, showNum: false });
    $("pre.cpp" + "Code").snippet("cpp", { style: stylename, showNum: false });
    $("pre.csharp" + "Code").snippet("csharp", { style: stylename, showNum: false });
    $("pre.css" + "Code").snippet("css", { style: stylename, showNum: false });
    $("pre.flex" + "Code").snippet("flex", { style: stylename, showNum: false });
    $("pre.html" + "Code").snippet("html", { style: stylename, showNum: false });
    $("pre.java" + "Code").snippet("java", { style: stylename, showNum: false });
    $("pre.javascript" + "Code").snippet("javascript", { style: stylename, showNum: false });
    $("pre.javascript_dom" + "Code").snippet("javascript_dom", { style: stylename, showNum: false });
    $("pre.perl" + "Code").snippet("perl", { style: stylename, showNum: false });
    $("pre.php" + "Code").snippet("php", { style: stylename, showNum: false });
    $("pre.python" + "Code").snippet("python", { style: stylename, showNum: false });
    $("pre.ruby" + "Code").snippet("ruby", { style: stylename, showNum: false });
    $("pre.sql" + "Code").snippet("sql", { style: stylename, showNum: false });
    $("pre.xml" + "Code").snippet("xml", { style: stylename, showNum: false }); */
}